package belf.migrate.api.common;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.gson.Gson;
import lombok.Data;

@Data
public class LogModel {

    private Long jobId;

    private String logContent;

    public LogModel(Long jobId, String logContent) {
        this.jobId = jobId;
        this.logContent = logContent;
    }

    public String toJson() throws JsonProcessingException {
        ObjectMapper mapper = new ObjectMapper();
        return mapper.writer().writeValueAsString(this);
    }
}
